package controllers;

import java.text.DateFormat;
import java.text.ParseException;
import java.text.SimpleDateFormat;

import java.util.Date;
import java.util.GregorianCalendar;


public class Utile {
	
	public static Date stringToDate(String d) throws ParseException{
		DateFormat sdf =  new SimpleDateFormat("dd/MM/yyyy HH:mm");
		Date date = sdf.parse(d);
		return date;
	}
	
	public static String dateToString(GregorianCalendar gc) throws ParseException{
		DateFormat sdf =  new SimpleDateFormat("dd/MM/yyyy HH:mm");
		Date date= gc.getTime();
		String retourn=sdf.format(date);
		return retourn;
	}


}
